<% @first_day.upto(@last_day) do |this_date| %>
  <% if this_date < Date.today %>
    <li id="schedule-w-<%= Date::DAYNAMES[this_date.wday].downcase %>" class="past-day">
  <% else %>
    <li id="schedule-w-<%= Date::DAYNAMES[this_date.wday].downcase %>">
  <% end %>
  <h3><%= Date::DAYNAMES[this_date.wday] %></h3>
  <% if  @events.any? {|event| event.event_date == this_date.to_s } %>
    <ul>
      <% @events.find_all {|event| event.event_date == this_date.to_s }.each do |event| %>
        <% if event.end < 1.seconds.ago %>
          <li class="past-event"><%= event.start.strftime('%I:%M %p') %> <span><%= event.title %></span></li>
        <% else %>
          <li><%= event.start.strftime('%I:%M %p') %> - <%= event.end.strftime('%I:%M %p') %> <span><%= event.title %></span></li>
        <% end %>
      <% end %>
    </ul>
  <% else %>
  <ul>
    <li><span>There are no events scheduled</span></li>
  </ul>
  <% end %>
</li>
<% end %>
